*Sum up variables across plants---by Firm, Year
foreach var of varlist f1_exp_sale_it - capital_C_it  {
bys ID_FIRMA year: egen double temp = sum(`var')
replace `var' = temp
drop temp
}

*Keep only one observation for Firm, Year
bys ID_FIRMA year: gen first = year[_n] ~= year[_n+1]
keep if first == 1
drop first
drop ID_PLANTA CIIU3_3D


